#include "daemon.h"
#include "iomanager.h"
#include "log.h"

static johnsonli::Logger::ptr g_logger = LOG_ROOT();


johnsonli::Timer::ptr timer;


int server_main(int argc, char** argv) {
    LOG_INFO(g_logger) << johnsonli::ProcessInfoMgr::GetInstance()->toString();
    johnsonli::IOManager iom(1);
    iom.addTimer(1000, [](){
            LOG_INFO(g_logger) << "onTimer";
            static int count = 0;
            if(++count > 10) {
                exit(1);
            }
    }, true);
   return 0;
}

int main(int argc, char** argv) {
    return johnsonli::start_daemon(argc, argv, server_main, argc != 1);
}
